<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        h4 {
            margin: 50px;
            text-align: center;
        }

        .tabsbox {
            width: 1000px;
            border: 1px solid royalblue;
            margin: auto;
        }

        .firstnav {
            border-bottom: 1px solid orchid;
            position: relative;
            height: 66px;
            box-sizing: content-box;
        }

        .firstnav ul li {
            display: inline-block;
            border-right: 1px solid orchid;
            padding: 20px;
            width: 100px;
        }

        .tabadd {
            position: absolute;
            right: 10px;
            top: 5px;
            font-size: 30px;
        }

        .iconfont {
            position: relative;
            top: -12px;
            right: -40px;
            font-size: 20px;
        }

        .tabscon {
            height: 200px;
        }

        .tabscon section {
            display: none;
        }

        .tabscon .conactive {
            display: block;
        }

        .firstnav li span:first-child input {
            width: 60px;
            height: 20px;
            border: 1px solid pink;
            outline: none;
        }

        .liactive {
            background-color: orangered;
        }
    </style>
    <script src="/tab.js"></script>
</head>

<body>
    <main>
        <h4>js 面向对象 动态添加标签页</h4>
        <div class="tabsbox" id="tab">
            <nav class="firstnav">
                <ul>
                    <li class="liactive"><span>测试1</span><span class="iconfont icon-guanbi">×</span></li>
                    <li><span>测试2</span><span class="iconfont icon-guanbi">×</span></li>
                    <li><span>测试3</span><span class="iconfont icon-guanbi">×</span></li>
                </ul>
                <div class="tabadd">
                    <span>+</span>
                </div>
            </nav>
            <div class="tabscon">
                <section class="conactive">测试1</section>
                <section>测试2</section>
                <section>测试3</section>
            </div>
        </div>
    </main>
</body>


</html>